# Maintainer: Anatol Pomozov

pkgname=aws-c-auth
pkgver=0.6.26
pkgrel=1
pkgdesc='C99 library implementation of AWS client-side authentication: standard credentials providers and signing'
arch=(loong64 x86_64)
url='https://github.com/awslabs/aws-c-auth'
license=(Apache)
depends=(aws-c-common aws-c-http aws-c-sdkutils)
makedepends=(cmake)
source=(aws-c-auth-$pkgver.zip::https://github.com/awslabs/aws-c-auth/archive/v$pkgver.zip)
sha256sums=('b539a4a24eca72fd76a852e863816b9eee4688541904678ccb8162351e637ca2')

build() {
  cd aws-c-auth-$pkgver

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -S . -B build
  cmake --build build
}

check() {
  cd aws-c-auth-$pkgver
  cmake --build build --target test
}

package() {
  cd aws-c-auth-$pkgver

  cmake --build build --target install -- DESTDIR="$pkgdir/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
